<template>
  <div id="loading" v-show="show">
    <div>{{ msg }}</div>
  </div>
</template>

<script>
  export default {
    name: "loading",
    props: {
      show: Boolean,
      msg: {
        type: String,
        default: "正在加载...",
      },
    },
  }
</script>

<style lang="scss" scoped>
  #loading {
    width: 100%;
    height: 100%;
    background-color: rgba($color: #000000, $alpha: 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
    div {
      background-color: #333;
      padding: 0.1rem;
      color: #fff;
      text-align: center;
      border-radius: 0.08rem;
      font-size: 0.28rem;
    }
  }
</style>
